Field
This disclosure relates generally to environmental impact of code and, more specifically, to techniques for providing environmental impact information associated with code.
Related Art
Power management is a feature that has been implemented in various electrical devices (e.g., computer systems (computers) and computer peripherals such as monitors and printers) to turn-off power to a device or switch the device to a low-power state when the device is inactive. For example, power management for computers may be employed to prolong battery life for portable and embedded computers, reduce noise, and reduce operating costs. In general, when power consumption of a computer is reduced, the computer dissipates less heat which usually increases stability of the computer, saves money, and reduces environmental impact. Power management for microprocessors may address an entire processor or a specific processor area. For example, to decrease power consumption of a computer, dynamic voltage scaling may be employed (to modify a core voltage of one or more central processing units (CPUs)) and/or dynamic frequency scaling may be employed (to modify a clock rate of one or more CPUs). Some programs allow a user to manually adjust voltages/frequencies supplied to a CPU to reduce both the amount of heat produced and power consumed by the CPU. Other CPUs are configured to automatically under-volt/under-frequency a processor based on a current workload to reduce heat produced and power consumed by the CPUs.
A relatively well known power management standard for computers is the advanced configuration and power interface (ACPI), which is an open industry standard that allows an operating system (OS) to directly control associated hardware of a computer to reduce power consumption of the computer. ACPI is a successor to an earlier standard, known as advanced power management (APM), that allowed a basic input output system (BIOS) of a computer to control power management functions. The ACPI allows an OS to automatically turn-off components (e.g., monitors and hard disk drives (HDDs)) after, for example, set periods of inactivity. The ACPI also facilitates putting a computer in a hibernate state where most components (including a central processing unit (CPU) and random access memory (RAM)) are turned off. When a computer hibernates, the computer saves the contents of RAM to an HDD and powers down. On start-up, the computer reloads the saved content from the HDD.
Software is typically written in a high-level programming language (e.g., Fortran, C, C++), which is translated by a compiler into an executable or a set of shared objects that are stored together in libraries and loaded on demand by an executing program. These shared objects and executables comprise machine code (a set of instructions which a computer understands and executes). In general, compilers are designed to optimize the translation of high-level procedural code such that an associated machine code counter-part runs efficiently. Efficiency, in this regard, has usually referred to the speed at which a compiled program executes. Optimization may be limited, however, by the manner in which a programmer originally chose to compose associated high-level procedural code, since optimization searches for obvious code patterns that can be simplified to yield a more efficient execution. Due to the diversity of approaches that may be employed to achieve any given outcome using a high-level procedural programming language, optimization may be implemented through human reengineering of software code and/or at higher levels of competition among programmers, software engineers, and software design companies in an attempt to produce codes that achieve similar objectives more efficiently than codes of a competitor.